stages:
- deploy
- fail
- ok

#cache:
#  key: "$CI_BUILD_REF_NAME"
#  paths:
#  - shared/

pages:
  stage: deploy
  script:
  - echo $CI_BUILD_REF_NAME
  - apt-get update
  - apt-get -y -qq install git-core zip gcc zlib1g-dev ca-certificates libxml2-utils python python-pyvorbis python-ogg python-pil
  - cd ..
  - rm -rf tools
  - git clone --depth 1 https://gitlab.com/evol/evol-tools.git tools
  - pwd
  - ./tools/gitlab-ci/clientdata.sh
  - pwd
  - ls clientdata/shared
  artifacts:
    paths:
     - shared
#    - public
  only:
  - pagestest
 
ok_job:
  stage: ok
  script:
  - pwd
  - echo $CI_BUILD_REF_NAME
  - ls shared
  - apt-get update
  - apt-get -y -qq install ii psmisc pastebinit
  - cd ..
  - rm -rf tools
  - git clone --depth 1 https://gitlab.com/evol/evol-tools.git tools
  - pwd
  - ls
  - ls clientdata
  - ls clientdata/shared
  - ./tools/gitlab-ci/susseccaction.sh
  when: on_success
  artifacts:
    paths:
     - shared
  dependencies:
  - pages
  only:
  - pagestest

fail_job:
  stage: fail
  script:
  - pwd
  - echo $CI_BUILD_REF_NAME
  - ls shared
  - apt-get update
  - apt-get -y -qq install ii psmisc pastebinit
  - cd ..
  - rm -rf tools
  - git clone --depth 1 https://gitlab.com/evol/evol-tools.git tools
  - ls clientdata/shared
  - ./tools/gitlab-ci/failaction.sh
  when: on_failure
  artifacts:
    paths:
     - shared
  dependencies:
  - pages
  only:
  - pagestest

